import java.lang.reflect.Proxy;
import java.nio.ByteBuffer;
import java.util.Arrays;

public class ProxyPractice {

    public static void main(String[] args) {
        final Person zxk = (Person) Proxy.newProxyInstance(
                Person.class.getClassLoader(),
                new Class[]{Person.class},
                (proxy, method, args1) -> {
                    System.out.println("Hello, " + args1[0]);
//                     method.invoke(proxy, args1);
                    return "null";
                }
        );
        System.out.println(Arrays.toString(zxk.getClass().getInterfaces()));
        zxk.sayHello("zxk");
    }

}
